# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgname=python-olefile
_pyname=olefile
pkgver=0.46
pkgrel=6
pkgdesc='Python library to parse, read and write Microsoft OLE2 files (formerly OleFileIO_PL)'
url='https://www.decalage.info/olefile'
arch=('any')
license=('BSD')
depends=('python')
checkdepends=('python-pytest')
replaces=('python3-olefileio')
conflicts=('python3-olefileio')
source=(${_pyname}-${pkgver}.tar.gz::https://github.com/decalage2/olefile/archive/v${pkgver}.tar.gz)
sha512sums=('e70975cdda11004ab331908085e0cbd9cf3e44f49fa1453a7af5373bfed0a98729bb7600fee7a1042be6c40c58649f3650972d9e4520bbab218cf715f6264f98')

build() {
  (cd ${_pyname}-${pkgver}
    python setup.py build
  )
}

check() {
  (cd ${_pyname}-${pkgver}
    py.test
  )
}

package() {
  cd ${_pyname}-${pkgver}
  python setup.py install -O1 --root="${pkgdir}" --prefix=/usr --skip-build
  install -Dm 644 LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -Dm 644 README.md doc/*.rst -t "${pkgdir}/usr/share/doc/${pkgname}"

}

# vim: ts=2 sw=2 et:
